package com.kzj.laimeimei.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import com.kzj.laimeimei.R;
import com.umeng.analytics.MobclickAgent;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by yan on 2015/8/30.
 */
public class StartPage extends Activity {
    private ImageView start;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        MobclickAgent.openActivityDurationTrack(false);
        start = (ImageView) findViewById(R.id.start);
        start.postDelayed(new Runnable() {
            @Override
            public void run() {
                StartPage.this.finish();
                Intent intent = new Intent(StartPage.this, MainActivity.class);
                startActivity(intent);
            }
        }, 2000);
    }
    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart(getClass().getSimpleName()); //统计页面(仅有Activity的应用中SDK自动调用，不需要单独写)
        MobclickAgent.onResume(this);          //统计时长
        JPushInterface.onResume(this);
    }
    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd(getClass().getSimpleName()); // （仅有Activity的应用中SDK自动调用，不需要单独写）保证 onPageEnd 在onPause 之前调用,因为 onPause 中会保存信息
        MobclickAgent.onPause(this);
        JPushInterface.onPause(this);
    }
}
